<script setup>
import { ref } from "vue";
import login from "./components/login.vue";
import register from "./components/register.vue";

// 标记页面 0 登录  1 注册
const flag = ref(0);
</script>

<template>
  <view class="auth">
    <view class="auth__login" v-if="!flag"><login /></view>
    <view class="auth__register" v-else>
      <register />
    </view>

    <!-- 底部切换 -->
    <view class="auth__footer">
      <view v-if="flag" class="auth__footer-item" @click="flag = 0"
        >已有账号，去登录</view
      >
      <view v-else class="auth__footer-item" @click="flag = 1"> 去注册 </view>
    </view>
  </view>
</template>
